#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "uthash.h"

#include <iso646.h>

int dayOfYear(char* date);

int main()
{
	return 0;
}

int dayOfYear(char* date)
{
	char month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

	int year = atoi(date), mon = atoi(date + 5), day = atoi(date + 8), res = 0;
	if (year % 400 == 0 || (year % 4 == 0 && year % 100)) month[1]++;

	for (int i = 0; i < mon - 1; i++) res += month[i];

	return res + day;
}
